<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/4/3
  Time: 15:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="cn.mldn.lzs.factory.*" %>
<%@ page import="cn.mldn.lzs.vo.Emp" %>
<%@ page import="java.text.*" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Emp emp = new Emp();
    emp.setEmpno(Integer.parseInt(request.getParameter("empno")));
    emp.setEname(request.getParameter("ename"));
    emp.setJob(request.getParameter("job"));
    emp.setHiredate(new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("hiredate")));
    emp.setSal(Float.parseFloat(request.getParameter("sal")));
    try {
        if(DAOFactory.getEmpDAOInstance().doCreate(emp)){
%>
    <h3>雇员信息添加成功!</h3>
<%
        }
        else {
            %>
              <h3>雇员信息添加失败！</h3>
            <%
        }
    }catch (Exception e){
        e.printStackTrace();
    }finally {

    }
%>

</body>
</html>
